# -*- coding: utf-8 -*-
"""
@Time: 2022/7/27 15:52
@Author: jins
@File: table_unit_0727.py
@Introduction:
"""
from common.mysqlDataOperate import OperateMysql


def insert():
    op = OperateMysql(version='221_n')
    # for i in range(100000001, 100329990, 11):
    res = [i for i in range(100000001, 100330001) if (i - 100000001) % 11 != 0]
    for i in res:
        sql = f"""INSERT INTO calc_center.calc_rela values (
        '{i}',
        '{i}',
        'device',
        '{i}',
        'efat_actual_kwh',
        '+',
        1.000,
        1,
        0,
        0,
        '2022-07-27 16:00:00',
        '2023-07-27 16:00:00',
        'test',
        '2022-07-27 16:00:00',
        'jins',
        '2022-07-27 16:00:00',
        'jins',
        0)"""
        op.batch_excute(sql)
        if i % 500 == 0:
            op.commit()
            print(f'提交了{i}个')
    op.commit()
    op.close()


insert()
